/**
 * 剑指 Offer 41. 数据流中的中位数
 * https://leetcode-cn.com/problems/shu-ju-liu-zhong-de-zhong-wei-shu-lcof/
 */
public class Solutions_Offer_41 {
    public static void main(String[] args) {
        MedianFinder obj = new MedianFinder();
        obj.addNum(1);
        obj.addNum(2);
        double res1 = obj.findMedian();  // output: 1.5  ((1 + 2) / 2)
        System.out.println(res1);
        obj.addNum(3);
        double res2 = obj.findMedian();  // output: 2
        System.out.println(res2);
    }
}